import Vue from "vue"
import Vuex from 'vuex'
Vue.use(Vuex)


const store = new Vuex.Store({

	state: {
		name: '',
		hotel: '',
		password: '',
		openid: '',
		session_key: '',
		token: '',
		car: [],
    hotelId:"",
		isPaySuccess: false,
	},

	actions: {
		changeOpneId(state, openid, sessionKey) {
			state.openid = openid
			state.openid = sessionKey
		},
		addCart(state, item) {
			console.log("vuve", item)
			state.car = item
		}
	},
	mutations: {
		changeName(state, name, password) {
			state.name = name
			state.password = password
		},
		getToken(state, token) {
			state.token = token
		},
    setHotelId(state,hotelId){
      state.hotelId = hotelId
    }

	}

})

export default store